<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
<script>

    let n = setInterval(function() {
        console.log("一秒执行一次")
    }, 1000)

    // 关闭定时器
    clearInterval(n)
</script>


</body>
</html>